var schoolUrl = '/pvm/school/getSchoolList';
// var gradeUrl = '/pvm/grade/getGradeList';
// var classUrl = '/pvm/class/getClassList';

var nameCheck = (rule, value, callback) => {
  let namereg=/^\S+$/
    if(!namereg.test(value)){
      callback(new Error('不允许有空格'))
    }else{
      callback()
    }
};




export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "column": [
	  {
      "type": "input",
      "label": "学生编号",
      "prop": "id",
      span: 24,
      hide: true,
      addDisplay: false,
      editDisabled: true
    },	  {
      "type": "input",
      "label": "学生名称",
      "prop": "studentName",
      search: true,
      rules: [{
        required: true,
        message: '请输入用户名',
        trigger: 'blur'
      },
        {validator: nameCheck, trigger: 'blur'}
      ],
      span: 24,
    },	  {
      "type": "select",
      "label": "就读学校",
      "prop": "schoolId",
      formslot: true,
      props: {
        label: 'schoolName',
        value: 'id'
      },
      search:true,
      dicUrl: `${schoolUrl}`,
      rules: [{
        required: true,
        message: '请选择学校',
        trigger: 'change'
      }],
      hide: true,

    },	  {
      "type": "input",
      "label": "就读学校",
      "prop": "schoolName",
      addDisplay: false,
    },	  {
      "type": "select",
      "label": "就读年级",
      "prop": "gradeId",
      formslot: true,
      props: {
        label: 'gradeName',
        value: 'id'
      },
      hide: true,
      // search:true,
      // dicFlag: false,
      // dicUrl: `${gradeUrl}`,
      rules: [{
        required: true,
        message: '请选择年级',
        trigger: 'change'
      }],

    },	  {
      "type": "input",
      "label": "就读年级",
      "prop": "gradeName",
      addDisplay: false,
    },	  {
      "type": "select",
      "label": "就读班级id",
      "prop": "classId",
      formslot: true,
      hide: true,
      // dicUrl: `${classUrl}`,
      props: {
        label: 'className',
        value: 'id'
      },
      rules: [{
        required: true,
        message: '请选择班级',
        trigger: 'change'
      }],

    },	  {
      "type": "input",
      "label": "就读班级",
      "prop": "className",
      addDisplay: false,
    },	  {
      "type": "input",
      "label": "就读学校年级班级总称",
      "prop": "fullName",
      span: 24,
      addDisplay: false,
    },	  {
      "type": "input",
      "label": "学号",
      "prop": "sno"
    },	  {
      type: "radio",
      label: "状态",
      prop: "status",
      slot: true,
      rules: [{
        required: true,
        message: '请选择状态',
        trigger: 'blur'
      }],
      dicData: [{
        label: '正常',
        value: 0
      }, {
        label: '转学',
        value: 1
      }, {
        label: '休学',
        value: 2
      }]
    },	  {
      "type": "input",
      "label": "学年开始",
      "prop": "fromYear"
    },	  {
      "type": "input",
      "label": "学年结束",
      "prop": "toYear"
    },	  {
      "type": "input",
      "label": "打印次数",//0,1,2,3
      "prop": "printFlag",
      hide: true,
      addDisplay: false,
    },	  {
      "type": "input",
      "label": "打印操作人ID",
      "prop": "printId",
      hide: true,
      addDisplay: false,
    },	  {
      "type": "input",
      "label": "删除标记",//,1为未删除,-1为删除
      "prop": "delFlag",
      span: 24,
      hide: true,
      addDisplay: false,
      editDisplay: false
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      span: 24,
      hide: true,
      addDisplay: false,
      editDisabled: true
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "createUser",
      span: 24,
      addDisplay: false,
      editDisabled: true
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      span: 24,
      addDisplay: false,
      hide:true,
      editDisabled: true
    },	  {
      "type": "input",
      "label": "修改人",
      "prop": "updateUser",
      span: 24,
      hide:true,
      addDisplay: false,
      editDisabled: true
    }  ]
}
